<!-- 
蜂鸟地图相关的主功能页面
说明：
1.简单的小图片（50左右）标注，使用FMImageMarker
2.大型图片或者【文字+图片】、【图+图片】、gif等，使用FMDomMarker，不然切换视角的时候，视觉偏差很明显
 -->
<template>
  <div class="fmap-container" :class="{ 'is-kshqxf': is_kshqxf }">
    <!-- 筛选 -->
    <search
      :style="searchStyle"
      ref="sousuo"
      class="fmap-search-wrap"
      :id="options.id"
      :isUnityMap="false"
      @initFengMap="initFengMap"
      @setFengMap="setFengMap"
      @setDayCheckData="setDayCheckData"
      @showHiddenGroupMarker="showHiddenGroupMarker"
      @searchLocation="searchLocation"
      @changeMapType="changeMapType"
    ></search>
    <!-- 室外 -->
    <div class="outFengMap" v-show="isOutDoor" id="outFengMap"></div>
    <!-- 室内 -->
    <div class="inDoorFMap" v-show="!isOutDoor" id="inDoorFMap"></div>
  </div>
</template>

<script>
import loadFengmap from '@/libs/fmap/loadFengmap.js'
import Search from './FMapCompt/Search'
import { getSkipIndoorInfo, getMarkers } from '@/api/indoorMap'

let currentMap = null //当前地图对象
let outFengMap = null //室外地图对象
let inDoorFMap = null // 室内地图对象
let lastFmapId_out = null //上次蜂鸟地图id-室外
let lastFmapId_inDoor = null //上次蜂鸟地图id-室内
let naviAnalyser = null //定义路径规划对象
let clickFlag = false //是否开启点击地图获取起/终点
let clickCount = 0 //点击次数
let lastCoord = null //判断起点是否是同一处坐标
let coords = [] //起终点坐标
//图层变量
let mainLayers = [] //主要的marker 图层数组
let subLayers = [] //起点、终点、安全出口、呼叫中心 图层数组
let aroundLayers = [] //周边markert 图层数组
let buildMarkers = [] //建筑物顶部图层
let buildLayer = ''
//标注物变量
let allMarker = [] //所有标注
let circleMaker = null //周边画圈marker

let navi //导航对象
let type = null //工具包点击类型

let inspectMaplocations = [] //巡检坐标记录，划线用
let oldMakerId = null //周边画圈原来的楼层id
let isFirstMaintainMarker = true //第一次维保标注需要定位
let dayCheckData = null //记录日常巡检打点数据，单多层切换的时候需要重新打点
let heatmapOverlay = null //热力图实例
let hotGroupLayer = '' //热力图图层
let buildMarksData = ''
export default {
  name: 'FMap',
  components: {
    Search,
  },
  data() {
    return {
      is_kshqxf: false,
      loading: false,
      searchStyle: { left: this.bsConfig.LeftMenu.width },
      hidden: true, //清除文字标识
      isHide: true, //清除图标标识
      mapSpace: ['20', '50', '70', '90', '130', '150'], //高度集合
      mapThemes: [], //主题集合
      options: {},
      isOutDoor: 1, //室外1 室内0
      planarFlag: false, //定义二维/三维模式变量
      firstClickTime: null, //初次点击
      isFromHome: true, //是否是首页
      changeRotateNum: false, //切换调整角度的+-
      pushData: null, //推送跳地图需要标注点
      fixedPositionData: null, //其他地图定位需要标注的点
      mapLoaded: true, // 地图加载好后，才接收下次加载
      markerNeedJump: false, //切换地图是否需要标注点是否需要jump
      isMuilUnitUser: this.$store.state.userInfo.isMuilUnitUser,
    }
  },
  computed: {
    isOutDoorValue() {
      return this.$store.state.isOutDoor
    },
  },
  watch: {
    isOutDoor(val, oldVal) {
      if (val == oldVal) {
        return
      }
      currentMap = val == 0 ? inDoorFMap : outFengMap
      this.initNaviAnalyser()
      localStorage.setItem('ilinkBs_inoutDoorType', val)
    },
    isOutDoorValue(val) {
      this.isOutDoor = val
    },
    '$store.state.buildMarkType'(val) {
      let currentRoute = this.$Ctl.getCurrentPage()
      if (
        buildMarksData &&
        buildLayer &&
        ((this.isMuilUnitUser == 1 && currentRoute.name == 'SingleHome') ||
          (this.isMuilUnitUser != 1 && currentRoute.name == 'Home'))
      ) {
        buildMarkers.forEach((marker, index) => {
          if (marker) {
            try {
              buildLayer.removeMarker(marker)
            } catch (e) {}
          }
        })
        buildMarkers = []
        this.initFengMapMarks(
          {
            51: buildMarksData,
          },
          false,
          false
        )
      }
    },
  },
  created: function () {
    const that = this
    window.FunList.changeTheme_FMap = that.changeFMapTheme
    window.FunList.distanceMeasure_FMap = that.distanceMeasure //路径规划 /量距
    window.FunList.highMeasure_FMap = that.highMeasure
    window.FunList.clearanceMarkers_FMap = that.clearanceMarkers
    window.FunList.changeMode_FMap = that.changeMode
    window.FunList.lookAround_FMap = that.lookAround
    window.FunList.adjustSpacing_FMap = that.adjustSpacing
    window.FunList.hideMarkers_FMap = that.hideMarkers
    window.FunList.hiddenText_FMap = that.hiddenText
    window.FunList.Navigation_FMap = that.Navigation
    window.FunList.fixedPosition_FMap = that.eqLocation
    window.FunList.InspectionLocation_FMap = that.InspectionLocation //日常巡检切换地图
    window.FunList.periphery_FMap = that.periphery
    window.FunList.peripheryLocation_FMap = that.peripheryLocation //点击周边列表设备定位
    window.FunList.pushDataToMap_FMap = that.pushDataToMap
    window.FunList.transLocation_FMap = that.transLocation //坐标转换
    window.FunList.drawLineToOut_FMap = that.drawLineToOut //安全出口划线
    window.FunList.addCallMarker_FMap = that.addCallMarker //呼叫中心打点
    window.FunList.showDataHeatmap_FMap = that.openHeatmap //显示热力图
    window.Function.fengmapDomClik = that.fengmapDomClik

    // 花桥的地图背景图片用星空
    this.is_kshqxf = localStorage.getItem('ilinkBs_platformCode') === 'kshqxf'
  },
  methods: {
    // 蜂鸟地图上用dom画的标注物点击事件
    fengmapDomClik(markType, param) {
      const that = this
      if (markType == 22) {
        //巡检点位
        that.$Ctl.openPopup('PatrolPoint', param.bizId)
      } else if (markType === 32) {
        //隐患
        that.$Ctl.openPopup('HiddenDanger', param.bizId)
      } else if (markType == 33) {
        //维保
        /* that.$Ctl.enterChild("Maintenance", {
                    orgIds: param.orgId,
                    fbsId: param.bizId
                }); */
      } else if (markType === 34) {
        //单位安全指数
        that.$Ctl.enterSingleHome({
          orgId: param.orgId,
        })
      } else if (markType == 51) {
        //楼栋报警个数
        that.$Ctl.enterDetail('EquipmentList', {
          name: '',
          fbsId: param.fbsId,
          status: param.status,
          orgId: param.orgId,
        })
      } else if (markType == 9999) {
        //楼栋显示室内统计
        if (1 == that.isOutDoor && param.indoorMapId) {
          that.$refs.sousuo.mapDbClick(param.indoorMapId)
        }
      }
    },
    // dom标注主动移动下地图视角，不然位置会偏移
    changeRotate() {
      try {
        currentMap.rotateTo({
          //设置角度
          to: currentMap.rotateAngle + (this.changeRotateNum ? 0.1 : -0.1),
          //动画持续时间，默认为。3秒
          duration: 1,
          callback: function () {
            //回调函数
            console.log('rotateTo complete!')
          },
        })
        this.changeRotateNum = !this.changeRotateNum
      } catch (error) {}
    },
    // 每次进入单、多单位首页或者进入室内地图，设置中心点、缩放比例等
    initCenter() {
      // if (!currentMap.groupIDs) return;
      this.mapLoaded = true
      //设置所有楼层可见
      currentMap.visibleGroupIDs = currentMap.groupIDs
      currentMap.focusGroupID = currentMap.groupIDs[0]
      currentMap.moveToCenter(currentMap.groupIDs[0] * 1) // 视角回到地图中心点
      if (this.options.maxTilt) {
        try {
          let maxTilt = JSON.parse(this.options.maxTilt)
          currentMap.tiltAngle = maxTilt.tiltAngle * 1
          currentMap.rotateAngle = maxTilt.rotateAngle * 1
          currentMap.focusGroupID = maxTilt.groupID * 1
          currentMap.groupSpace = maxTilt.groupSpace
            ? maxTilt.groupSpace * 1
            : 15
          //中心点
          let pnt = {
            x: maxTilt.x * 1,
            y: maxTilt.y * 1,
            groupID: maxTilt.groupID * 1,
          }
          //跳转
          currentMap.moveTo(pnt)
        } catch (error) {}
      }
      currentMap.scaleLevelTo({
        level: this.options.scaleLevel || 18,
      })
    },
    //加载蜂鸟地图
    initFengMap(option, callback) {
      if (!option) return
      loadFengmap()
        .then(() => {
          this.mapLoaded = true
          if (!option) this.disposeMap()
          this.createMap(option, callback)
        })
        .catch((err) => {
          // console.error("地图加载失败：" + err);
        })
    },
    createMap(option, callback) {
      const that = this
      if (!that.mapLoaded) return
      if (option === {}) {
        return callback && callback()
      }
      that.mapLoaded = false // 地图开始加载
      //室外地图丢失的时候重新加载室外地图
      if (
        that.isOutDoor == 1 &&
        document.getElementById('outFengMap').children.length == 0
      ) {
        lastFmapId_out = 0
      }
      if (
        that.isOutDoor == 0 &&
        document.getElementById('inDoorFMap').children.length == 0
      ) {
        lastFmapId_inDoor = 0
      }

      // 根据参数切换场景
      if (option) that.changeMapType(option.sceneType == 1 ? 1 : 0)

      that.naviAnalyser = null
      type = null
      oldMakerId = null //初始化周边打点楼层
      // 如果是室外并且不是多单位首页
      if (that.isOutDoor == 1 && !that.isHomeMuil()) {
        that.$refs.sousuo.getOutDoorBuildInfo()
      }
      //清空搜索结果
      that.$refs.sousuo.restaurants = []
      that.options = option
      localStorage.setItem('ilinkBs_fIndoorMapId', that.options.id)
      //ilinkBs_fmapIndoorId 楼层id
      localStorage.setItem('ilinkBs_fmapIndoorId', '')

      //初始话的时候同一个地图不需要初始化
      if (!this.planarFlag) {
        if (
          (that.isOutDoor == 0 &&
            lastFmapId_inDoor &&
            that.options.fmapId &&
            that.options.fmapId === lastFmapId_inDoor &&
            document.getElementById('inDoorFMap').children.length != 0) ||
          (that.isOutDoor == 1 &&
            lastFmapId_out &&
            that.options.fmapId &&
            that.options.fmapId === lastFmapId_out &&
            document.getElementById('outFengMap').children.length != 0)
        ) {
          if (currentMap.groupIDs.length > 0) {
            that.$nextTick(() => {
              that.clearanceMarkers()
              that.initCenter()
              callback && callback(that.options)
            })
          }
          return
        }
      }

      that.$Ctl.loading(1, 10000)
      that.disposeMap()
      if (that.isOutDoor == 0) {
        lastFmapId_inDoor = that.options.fmapId
      } else {
        lastFmapId_out = that.options.fmapId
      }

      that.mapThemes = [
        '3001',
        '3002',
        '3003',
        '3004',
        '3005',
        '3006',
        that.options.topicName,
      ]
      // 清空dom操作要时间，所以做个延迟
      that.$nextTick(() => {
        //初始化地图对象
        currentMap = new fengmap.FMMap({
          //必要，地图容器
          container: document.getElementById(
            that.isOutDoor == 0 ? 'inDoorFMap' : 'outFengMap'
          ),
          //地图数据位置
          mapServerURL: REMOTESTATICPATH + 'fmap/data/' + that.options.fmapId,
          //主题数据位置
          mapThemeURL: REMOTESTATICPATH + that.options.topicUrl,
          //设置主题
          defaultThemeName: that.options.topicName,
          //支持单击模型高亮，false为单击时模型不高亮
          modelSelectedEffect: true,
          //必要，地图应用名称，通过蜂鸟云后台创建
          appName: that.options.appName,
          //必要，地图应用密钥，通过蜂鸟云后台获取
          key: that.options.appKey,
          //楼层间隔
          defaultGroupSpace: 25,
          //初始化地图等级大小
          // defaultMapScaleLevel: that.options.scaleLevel || 18,
          //初始化聚焦层数
          // defaultFocusGroup: 3,
          //除了聚焦层数其它楼层是否虚化
          focusAlphaMode: false,
          compassOffset: [$('.home-weather').offset().left + 148, 125], // 设置初始指南针的偏移量，默认为[28, 20],左：28px,上：20px。
          compassSize: 80,
          // //瓦片加载
          // tile:true
        })

        //对室内和室外做对应的处理
        if (that.isOutDoor == 0) {
          inDoorFMap = currentMap
        } else {
          this.$store.commit('setCurrentInspectId', '') //初始化日常巡检任务id

          localStorage.setItem('ilinkBs_outdoorMapId', that.options.id)
          outFengMap = currentMap
        }
        //打开Fengmap服务器的地图数据和主题
        currentMap.openMapById(that.options.fmapId, function (error) {
          that.mapLoaded = true
          //打印错误信息
          console.log(error)
        })
        //地图加载完成事件
        currentMap.on('loadComplete', () => {
          //console.log("地图加载完成！");
          /**
           * 显示指北针，设置背景色需要在加载指北针之前设置
           * */
          currentMap.compass.setBgImage(
            'resource/ilink_1600086750748.png' /* REMOTESTATICPATH + 'fmap/image/compass_bg.png' */
          ) //设置背景图片
          currentMap.compass.setFgImage(
            'resource/ilink_1600086313939.png' /* REMOTESTATICPATH + 'fmap/image/compass_fg.png' */
          ) //设置前景图片

          currentMap.showCompass = true
          //点击指北针事件, 使角度归0
          // currentMap.on("mapClickCompass", function() {});
          // 设置透明
          currentMap.setBackgroundColor('#2b8fff', 0)
          //地图手势对象
          let controller = currentMap.gestureEnableController
          controller.enableMapPan = true // 可移动
          controller.enableMapRotate = true // 可旋转
          controller.enableMapIncline = true //可倾斜
          controller.enableMapPinch = true //可缩放
          // controller.enableMapSingleTap = false; //不可单击
          that.initCenter()
          that.initNaviAnalyser()
          // 执行回调
          callback && callback(this.options)
          // 还原2D
          if (this.planarFlag) {
            this.planarFlag = false
            this.changeMode()
          }
          this.$Ctl.loading(0)
        })
        /**
         * 比例尺级别改变事件
         * 地图的比例尺级别,默认 1~29 级
         */
        /* currentMap.on("mapScaleLevelChanged", function(event) {
                    console.log('地图比例尺级别改变！', currentMap.mapScaleLevel);
                }); */
        //地图中鼠标悬停
        // currentMap.hoverFilterFunction = function (event) {
        // };
        // map.on('mapHoverNode', function (event) {
        //     console.log('模型悬停事件！');
        // });
        /**
         * 地图点击事件
         * 通过点击地图，获取位置坐标，添加对应imageMarker
         * */
        currentMap.on('mapClickNode', function (event) {
          let eventType = event.nodeType
          if (eventType !== 5) {
            if (eventType == 31 || eventType == 32) {
              let bizId = event.target.bizId
              let markType = event.target.type + ''
              if (markType == 3 || markType == 4) {
                //播放视频
                if (!that.$Ctl.getClickEnabel(1)) return
                that.$Ctl.getVideoDetail(bizId)
              } else if (markType == 81 || markType == 82 || markType == 83) {
                //消防车
                that.$Ctl.openPopup('CarDetail', bizId)
              } else if (markType == 'qishidian') {
                return //点击起始点不做任何操作(导航和测距的时候会用到)
              } else if (markType == 'rixunjian') {
                return //点击起始点不做任何操作(日常巡检)
              } else {
                //常规探测器集合
                that.$Ctl.openPopup('DeviceDetails', bizId)
              }
            }
            return
          }
          //室外双击
          if (that.isMapDbClick(event)) {
            return
          }
          if (type == 1) {
            // 测量高度
            let height = Number(event.target.height).toFixed(1)
            that.$Ctl.message(
              '<span class="message-title">高度</span>：<span class="message-value">' +
                height +
                ' 米</span>',
              3
            )
          } else if (type == 2) {
            // 测量距离
            if (
              event.target != null &&
              event.target.nodeType == fengmap.FMNodeType.MODEL &&
              naviAnalyser != null &&
              clickFlag
            ) {
              //封装点击坐标，模型中心点坐标
              let coord = {
                x: event.target.mapCoord.x,
                y: event.target.mapCoord.y,
                groupID: event.target ? event.target.groupID : 1,
              }
              //第一次点击
              if (clickCount === 0) {
                //上一次点击坐标，判断两次点击坐标是否一处
                lastCoord = coord
                //设置起点坐标
                coords[0] = coord
                //添加起点坐标
                that.addStartEndMarker(coord, 'start')
              } else if (clickCount === 1) {
                //第二次点击，添加终点并画路线
                //判断起点和终点是否相同
                if (lastCoord.x === coord.x && lastCoord.y === coord.y) {
                  return
                }
                //设置终点坐标
                coords[1] = coord
                //添加终点坐标
                that.addStartEndMarker(coord, 'end')
                //设置完起始点后，调用此方法画出导航线
                that.drawNaviLine()
              }
              clickCount++
            }
          } else if (type == 3) {
            //获取周边
            let locationArr = [
              {
                x: event.target.mapCoord.x,
                y: event.target.mapCoord.y,
                z: event.target.mapCoord.z,
                height: event.target.height,
                indoorId: event.target.groupID,
              },
            ]
            let parames = {
              location: JSON.stringify(locationArr), // 位置坐标
              orgId: localStorage.getItem('ilinkBs_orgIds'), // 联网单位Id
            }
            that.$Ctl.openPopup('Peripherals', '', parames)
          } else if (type == 4) {
            // console.log('导航')
            if (
              event.target != null &&
              event.target.nodeType == fengmap.FMNodeType.MODEL &&
              naviAnalyser != null &&
              clickFlag
            ) {
              //封装点击坐标，模型中心点坐标
              let coord = {
                x: event.target.mapCoord.x,
                y: event.target.mapCoord.y,
                groupID: event.target ? event.target.groupID : 1,
              }
              //第一次点击
              if (clickCount === 0) {
                //上一次点击坐标，判断两次点击坐标是否一处
                lastCoord = coord
                //设置起点坐标
                coords[0] = coord
                //添加起点坐标
                that.addStartEndMarker(coord, 'start')
              } else if (clickCount === 1) {
                //第二次点击，添加终点并画路线
                //判断起点和终点是否相同
                if (lastCoord.x === coord.x && lastCoord.y === coord.y) {
                  return
                }
                //设置终点坐标
                coords[1] = coord
                //添加终点坐标
                that.addStartEndMarker(coord, 'end')
                that.createNavi(coords)
              }
              clickCount++
            }
          }
        })
      })
    },
    //初始化标注
    initFengMapMarks(markData, isClear, isFromHome) {
      const that = this
      if (!currentMap) {
        return
      }
      that.isFromHome = isFromHome
      if (isClear) {
        // 清空所有图层，并把变量置空
        mainLayers.forEach((layer, index) => {
          if (layer) {
            try {
              layer.removeAll()
            } catch (e) {}
          }
        })
        mainLayers = []
        allMarker = []
        buildMarkers = []
        buildLayer = ''

        that.clearLineMark()
      }
      isFirstMaintainMarker = true

      if (!markData) {
        that.$Ctl.message('暂无该地图标注', 'info')
        return
      }
      //首页
      if (isFromHome) {
        that.initAlarmEquipt(markData)
      } else {
        //非首页
        for (let typeName in markData) {
          that.addMarksByType(markData[typeName] || [], typeName)
        }
      }

      if (that.pushData || that.fixedPositionData) {
        //定位勿删，不然地图跳转后无法定位
        if (that.fixedPositionData) {
          that.eqLocation(that.fixedPositionData)
        }
        //推送
        if (that.pushData) {
          that.$nextTick(() => {
            that.markerNeedJump = true
            that.addMarksByType(that.pushData.data, that.pushData.type)
            // 自动切到单层，且视角是2D
            // currentMap.visibleGroupIDs = [indoorId]
            this.$refs.sousuo.focusGroup(that.pushData.indoorId)
            currentMap.tiltAngle = 180
          })
          setTimeout(() => {
            if (that.pushData)
              this.$refs.sousuo.focusGroup(that.pushData.indoorId)
            currentMap.tiltAngle = 180
            that.pushData = null
            that.markerNeedJump = false
          }, 1000)
        }
      } else {
        // dom标注主动移动下地图视角，不然位置会偏移
        that.changeRotate()
      }
    },
    //转换首页数据结构
    initAlarmEquipt(markData) {
      const that = this

      for (let typeName in markData) {
        if (typeName !== 'init3dData' /*  && typeName !== "hidden" */) {
          $.each(markData[typeName] || [], (index, data) => {
            that.addMarksByType(data.data, data.type)
          })
        }
      }
    },
    //根据类型标注
    addMarksByType(data, type) {
      const that = this
      if (!data || !type) {
        return
      }
      // 缓存建筑物标记数据
      if (type == 51) {
        buildMarksData = data
      }
      for (let i = 0, len = data.length; i < len; i++) {
        let obj = data[i]
        //非本地图
        if (obj.indoorMapId && obj.indoorMapId != that.options.id) {
          continue
        }
        let locationObj = ''
        if (type == 22) {
          locationObj = JSON.parse(obj.mapLocation)
        } else if (type == 33) {
          locationObj = JSON.parse(obj.markInfo.mapLocation)
        } else {
          locationObj = JSON.parse(obj.info3d)
        }
        if (type == 34) {
          // 单位安全指数
          that.addScoreMarker(locationObj, obj)
        } else if (type == 32) {
          // 隐患
          that.addHiddenMarker(locationObj, obj.hiddenDetail || obj.val)
        } else if (type == 33) {
          // 维保
          if (!obj.markInfo) {
            continue
          }
          //非本地图
          if (that.options.id !== obj.markInfo.indoorMapId) {
            continue
          }
          that.addMaintainMarker(locationObj, obj, data)
        } else if (type == 22) {
          // 巡检
          //非本地图
          if (that.options.id !== obj.indoorMapId) {
            continue
          }
          if (obj.result != 2 && obj.result != -1) {
            // 划线 过滤掉巡检未完成的点
            inspectMaplocations.push(locationObj[0])
          }
          that.addInspectMarker(locationObj, obj)
        } else if (type == 51) {
          // 楼栋
          that.addBuildMarker(locationObj, obj)
        } else {
          // 设备报警
          if (obj.info3d) {
            //楼栋显示室内统计
            if (obj.val && 1 == that.isOutDoor) {
              that.addBuildStatisticsMarker(locationObj, obj)
              continue
            }
            that.addMarker(locationObj, obj, type)
          }
        }
      }
      that.$Ctl.loading(0)
      if (inspectMaplocations.length > 1) {
        const that = this
        // inspectMaplocations.reverse() // 数组需要翻转一下 改变路线方向
        that.drawInspectLine()
      }
      inspectMaplocations = []

      if (localStorage.getItem('ilinkBs_fmapIndoorId')) {
        that.showHiddenGroupMarker(localStorage.getItem('ilinkBs_fmapIndoorId'))
      }
    },

    /**
     * 添加呼叫中心打点
     */
    addCallMarker(type, headUrl) {
      //type:0清除  1 打点
      const that = this
      if (type == 0) {
        that.clearanceMarkers()
        return
      }
      if (headUrl == null) {
        headUrl = that.GLOBAL.defultMapPeople
      }
      let groupLayer = currentMap.getFMGroup(1)
      let markerCallLayer = new fengmap.FMImageMarkerLayer()
      groupLayer.addLayer(markerCallLayer)

      //标注对象，默认位置为该楼层中心点
      let call = new fengmap.FMImageMarker({
        url: headUrl, //设置图片路径
        x: groupLayer.mapCoord.x,
        y: groupLayer.mapCoord.y,
        size: 50,
        height: 2,
        callback: function () {
          call.alwaysShow()
          call.avoid(false)
        },
      })
      let coord = {
        x: groupLayer.mapCoord.x,
        y: groupLayer.mapCoord.y,
        time: 1,
        groupID: 1,
      }
      currentMap.moveTo(coord)
      markerCallLayer.addMarker(call)
      call.type = 'rixunjian' //呼叫中心打点类型
      allMarker.push(call)
      subLayers.push(markerCallLayer)
      if (that.markerNeedJump) {
        call.jump({ height: 3, times: 2 })
      }
    },

    /**
     * 添加安全出口
     */
    addSafeMarker(location, info, type) {
      const that = this
      let IconData = that.GLOBAL.mapMarkJsonData[type] //设备图

      let groupLayer = currentMap.getFMGroup(location[0].indoorId * 1)
      let markerSafeLayer = new fengmap.FMImageMarkerLayer()
      groupLayer.addLayer(markerSafeLayer)

      let bizId = info.id || 0
      //图标标注对象，默认位置为该楼层中心点
      let front = new fengmap.FMImageMarker({
        url: IconData.bdIcon, //设置图片路径
        x: location[0].x,
        y: location[0].y,
        id: info.id,
        name: info.name,
        size: 50,
        height: 2.5,
        callback: function () {
          front.alwaysShow()
          front.avoid(false)
        },
      })

      markerSafeLayer.addMarker(front)
      front.bizId = bizId
      front.type = type
      front.name = info.name
      front.groupId = location[0].indoorId
      allMarker.push(front)
      subLayers.push(markerSafeLayer)
      if (that.markerNeedJump) {
        front.jump({ height: 3, times: 2 })
      }
    },
    /**
     * 添加设备标记点（打点两张图片）
     * isAround //是否周边自定义图层打点
     */
    addMarker(location, info, type, isAround) {
      try {
        if (!location[0]) return
        const that = this
        let IconData = that.GLOBAL.mapMarkJsonData[type] //设备图
        let BgIcon = that.GLOBAL.mapMarkJsonData['bg-alarm-new'] //设备背景图
        //指定设备图类型打点
        let groupLayer = currentMap.getFMGroup(location[0].indoorId * 1)
        //创建图片标注层并添加到指定楼层上面。
        let markerLayer = new fengmap.FMImageMarkerLayer() //实例化ImageMarkerLayer
        groupLayer && groupLayer.addLayer(markerLayer) //添加图片标注层到模型层。否则地图上不会显示
        //指定背景图类型打点
        let bizId = info.id || 0
        //图标标注对象，默认位置为该楼层中心点
        let front = new fengmap.FMImageMarker({
          url: IconData.bdIcon, //设置图片路径
          x: location[0].x,
          y: location[0].y,
          z: location[0].z || 0,
          height: location[0].height || 2.5, //设置图片标注的高度
          id: info.id,
          name: info.name,
          size: 50, //设置图片显示尺寸
          callback: function () {
            front.alwaysShow()
            front.avoid(false)
          },
        })

        let background
        if (info.status && info.status !== 0) {
          background = new fengmap.FMImageMarker({
            url: BgIcon[info.status], //设置图片路径type设置设备类型
            x: location[0].x,
            y: location[0].y,
            z: location[0].z || 0,
            height: location[0].height || 2.5, //设置图片标注的高度
            id: info.id,
            name: info.name,
            size: 100, //设置图片显示尺寸
            callback: function () {
              // 在图片载入完成后，设置 "一直可见"，不被其他层遮挡
              background.alwaysShow()
              background.avoid(true)
            },
          })
          markerLayer.addMarker(background)
          background.bizId = bizId
          background.type = type
          background.name = info.name
          allMarker.push(background)
        }

        markerLayer.addMarker(front)
        front.bizId = bizId
        front.type = type
        front.name = info.name
        front.groupId = location[0].indoorId

        allMarker.push(front)

        if (isAround) {
          aroundLayers.push(markerLayer)
        } else {
          mainLayers.push(markerLayer)
        }

        if (that.markerNeedJump) {
          front.jump({ height: 3, times: 2 })
          background && background.jump({ height: 3, times: 2 })
        }
      } catch (e) {
        console.error(e)
      }
    },
    //隐患标注-室内(2张图)
    addHiddenMarker(location, info) {
      const that = this
      //status:隐患状态1:整改中、2:已完成，3:核实中，5:待指派
      let status = info.status || 1
      let bizId = info.id || 0
      let picUrl = info.picUrls.split(',')[0] || ''
      let picBg = that.GLOBAL.mapMarkJsonData[32].fmapIcon[status]
      if(picUrl.substring(picUrl.length-4) == ".mp4" || picUrl.substring(picUrl.length-4) == ".3gp" || picUrl.substring(picUrl.length-5) == ".mpeg" || picUrl.substring(picUrl.length-7) == ".mavip4" || picUrl.substring(picUrl.length-4) == ".flv" || picUrl.substring(picUrl.length-4) == ".mov"){
        picUrl = require('../../assets/images/videoImgDetail/video_img_detail.png')
      }

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '140',
        domHeight: '140',
        domContent:
          `<div class="domContainer-32" id="hiddenMarker${bizId}" onclick="window.Function.fengmapDomClik(32,` +
          JSON.stringify({ bizId: bizId }).replace(/"/g, '&quot;') +
          `)"><img src="` +
          picUrl +
          `" class="domContainer-32-pic"/><img src="` +
          picBg +
          `" class="domContainer-32-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM,
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)
    },
    //楼栋报警个数 概况-室外 图文
    addBuildMarker(location, info) {
      const that = this

      let bizId = info.id || 0
      let val = info.val
      let status = val.status
      if (!status && localStorage.getItem('Build_Top') != 2) return // 正常的楼栋不标注报警数
      let count = val.count || ''
      count = count > 99 ? '99+' : count
      let picBg = that.GLOBAL.mapMarkJsonData[51].fmapIconNew[status]
      if (localStorage.getItem('Build_Top') == 2) {
        picBg = 'static/images/bg-device-rate.png'
        count = val.normalPercent || ''
        if (!val.allFcfCount) return
      }

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '100',
        domHeight: '100',
        domContent:
          `<div class="domContainer-51" onclick="window.Function.fengmapDomClik(51,` +
          JSON.stringify({
            fbsId: val.fbsId,
            status: status,
            orgId: val.orgId,
          }).replace(/"/g, '&quot;') +
          `)"><span>` +
          count +
          `</span><img src="` +
          picBg +
          `" class="domContainer-51-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM, //设置图片显示尺寸
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)
      buildLayer = dmLayer
      buildMarkers.push(domMarker)
    },
    //巡检(1张图)
    addInspectMarker(location, info) {
      const that = this

      //楼栋上，为了划线，不标注
      // if (info.markType == 2) {
      //     return;
      // }

      let status = info.result
      let bizId = info.id || 0
      let picUrl =
        that.GLOBAL.mapMarkJsonData[22].bdIcon[status == -1 ? '-1' : status]

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '100',
        domHeight: '100',
        domContent:
          `<div class="domContainer-22" onclick="window.Function.fengmapDomClik(22,` +
          JSON.stringify({ bizId: bizId }).replace(/"/g, '&quot;') +
          `)"><img src="` +
          picUrl +
          `" class="domContainer-22-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM,
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)
    },
    //单位安全指数
    addScoreMarker(location, info) {
      const that = this

      let val = info.val * 1
      let bizId = info.id
      let index = 0
      //风险,高危,安全
      if (79.9 < val && val < 89.9) {
        index = 1
      } else if (val < 80) {
        index = 0
      } else {
        index = 2
      }
      let picBg = that.GLOBAL.mapMarkJsonData[34].fmapIcon[index]

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '100',
        domHeight: '100',
        domContent:
          `<div class="domContainer-34 mark-jump" onclick="window.Function.fengmapDomClik(34,` +
          JSON.stringify({ orgId: info.orgId }).replace(/"/g, '&quot;') +
          `)"><span>` +
          val +
          `</span><img src="` +
          picBg +
          `" class="domContainer-34-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM,
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)
    },
    //维保 图文
    addMaintainMarker(location, info, data) {
      const that = this

      let bizId = info.id || 0
      let percent = (info.percent || 0) + '%'
      let picBg = that.GLOBAL.mapMarkJsonData[33].fmapIcon

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '160',
        domHeight: '160',
        domContent:
          `<div class="domContainer-33" onclick="window.Function.fengmapDomClik(33,` +
          JSON.stringify({
            bizId: bizId,
            orgId: info.markInfo.orgId,
          }).replace(/"/g, '&quot;') +
          `)"><span>` +
          percent +
          `</span><img src="` +
          picBg +
          `" class="domContainer-33-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM, //设置图片显示尺寸
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)

      if (isFirstMaintainMarker) {
        // // 如果返回的维保个数 超过一个就不进行视角飞行; 切换成楼栋的时候 就视角飞行
        if (data.length > 1) {
          currentMap.moveToCenter(location[0].indoorId * 1) // 视角回到地图中心点
          currentMap.mapScaleLevel = 18
          isFirstMaintainMarker = false
          return
        }
        let coord = {
          x: location[0].x,
          y: location[0].y,
          groupID: location[0].indoorId * 1,
        }
        currentMap.moveTo(coord)
        currentMap.mapScaleLevel = 20
        isFirstMaintainMarker = false
      }
    },
    //楼栋显示室内统计
    addBuildStatisticsMarker(location, info) {
      const that = this

      let bizId = info.id || 0
      let count = info.val
      let picBg = that.GLOBAL.mapMarkJsonData[2].bulidBg

      let domMarker = new fengmap.FMDomMarker({
        x: location[0].x,
        y: location[0].y,
        z: location[0].z || 0,
        height: location[0].height || 2.5,
        domWidth: '100',
        domHeight: '100',
        domContent:
          `<div class="domContainer-9999" onclick="window.Function.fengmapDomClik(9999,` +
          JSON.stringify({
            indoorMapId: info.remark,
          }).replace(/"/g, '&quot;') +
          `)"><span>` +
          count +
          `</span><img src="` +
          picBg +
          `" class="domContainer-9999-bg" /></div>`,
        anchor: fengmap.FMMarkerAnchor.BOTTOM, //设置图片显示尺寸
      })

      let dmLayer = currentMap
        .getFMGroup(location[0].indoorId * 1)
        .getOrCreateLayer('domMarker')
      domMarker.bizId = bizId
      dmLayer.addMarker(domMarker)
      allMarker.push(domMarker)
      mainLayers.push(dmLayer)
    },
    //巡检划线
    drawInspectLine() {
      const that = this

      let lineStyle = {
        lineWidth: 8,
        alpha: 0.9,
        url: '',
        smooth: true,
        //设置线的颜色，十六进制颜色值
        //godColor: '#FF0000',
        //设置边线的颜色,十六进制颜色值
        //godEdgeColor: '#FF0000',
        //设置线的类型为导航线
        lineType: fengmap.FMLineType.FMARROW,
        noAnimate: false,
      }
      //创建路径线图层
      let line = new fengmap.FMLineMarker()
      let naviResults = []

      for (let i = 0; i < inspectMaplocations.length; i++) {
        if (naviResults.length == 0) {
          naviResults.push({
            groupId: inspectMaplocations[i].indoorId,
            points: [
              {
                x: inspectMaplocations[i].x,
                y: inspectMaplocations[i].y,
                z: 10,
              },
            ],
          })
        } else {
          let sameFlag = true
          for (let j = 0; j < naviResults.length; j++) {
            if (naviResults[j].groupId == inspectMaplocations[i].indoorId) {
              naviResults[j].points.push({
                x: inspectMaplocations[i].x,
                y: inspectMaplocations[i].y,
                z: 10,
              })
              break
            }
            sameFlag = false
          }
          if (sameFlag) {
            continue
          }
          naviResults.push({
            groupId: inspectMaplocations[i].indoorId,
            points: [
              {
                x: inspectMaplocations[i].x,
                y: inspectMaplocations[i].y,
                z: 10,
              },
            ],
          })
        }
      }

      //循环results中坐标点集合，通过坐标点绘制路径线
      for (let i = 0; i < naviResults.length; i++) {
        let result = naviResults[i]
        //创建FMSegment点集，一个点集代表一条折线
        let seg = new fengmap.FMSegment()
        seg.groupId = result.groupId
        seg.points = result.points
        //将FMSegment绘制到线图层上
        line.addSegment(seg)
        //绘制线
        currentMap.drawLineMark(line, lineStyle)
      }
    },
    /**
     * 工具包
     */
    //构造路径分析
    initNaviAnalyser() {
      loadFengmap()
        .then(() => {
          naviAnalyser = new fengmap.FMNaviAnalyser(currentMap)
        })
        .catch((err) => {})
    },
    /**
     * 添加起点终点marker
     * coord: 模型中心点坐标
     * type: start-起点坐标， end-终点坐标
     * */
    addStartEndMarker(coord, type, needJump) {
      const that = this
      //获取目标点层
      let markerUrl = ''
      let group = currentMap.getFMGroup(coord.groupID)
      //创建marker，返回当前层中第一个imageMarkerLayer,如果没有，则自动创建
      let layer = group.getOrCreateLayer('imageMarker')
      //判断该楼层layer是否存在，清除marker时需要将所有楼层marker都清除
      let isExistLayer = subLayers.some(function (item, index, array) {
        return item.groupID === coord.groupID
      })
      if (!isExistLayer) {
        subLayers.push(layer)
      }
      if (type === 'start') {
        //起点
        markerUrl = 'resource/ilink_1564058147093.png'
      } else if (type == 'dingwei') {
        //定位
        markerUrl = 'resource/ilink_1568812479176.png'
      } else if (type === 'end') {
        //终点
        markerUrl = 'resource/ilink_1564058171614.png'
      }
      //图标标注对象，默认位置为该楼层中心点
      let im = new fengmap.FMImageMarker({
        x: coord.x,
        y: coord.y,
        url: markerUrl,
        size: 32,
        height: 2,
        callback: function () {
          // 在图片载入完成后，设置 "一直可见"，不被其他层遮挡
          im.alwaysShow()
        },
      })
      im.type = 'qishidian'
      //周边消防设施打点
      if (coord.url) {
        let im = new fengmap.FMImageMarker({
          x: coord.x,
          y: coord.y,
          url: coord.url,
          size: 32,
          height: 2,
          callback: function () {
            // 在图片载入完成后，设置 "一直可见"，不被其他层遮挡
            im.alwaysShow()
          },
        })
        im.bizId = coord.id
      }

      //添加imageMarker
      layer.addMarker(im)
      if (needJump) {
        im.jump({
          height: 3,
          times: 2,
        })
      }
    },
    //根据已加载的fengmap.FMMap导航分析，判断路径规划是否成功
    drawNaviLine() {
      const that = this
      let analyzeNaviResult = naviAnalyser.analyzeNavi(
        coords[0].groupID,
        coords[0],
        coords[1].groupID,
        coords[1],
        fengmap.FMNaviMode.MODULE_SHORTEST
      )
      if (fengmap.FMRouteCalcuResult.ROUTE_SUCCESS != analyzeNaviResult) {
        that.clearanceMarkers()
        that.$Ctl.message('该位置不支持导航或者量距', 'info')
        return
      }
      //获取路径分析结果对象，所有路线集合
      let results = naviAnalyser.getNaviResults()
      if (results.length > 2) {
        results.splice(0, results.length - 1)
      } else if (results.length == 0) {
        that.clearanceMarkers()
        that.$Ctl.message('该位置不支持导航或者量距', 'info')
        return
      }
      //初始化线图层
      let line = new fengmap.FMLineMarker()
      for (let i = 0; i < results.length; i++) {
        let result = results[i]
        //楼层id
        let gid = result.groupId
        //路径线点集合
        let points = result.getPointList()

        let points3d = []
        points.forEach((point) => {
          points3d.push({
            //x坐标点
            x: point.x,
            //y坐标点
            y: point.y,
            //线标注高度
            z: 2,
          })
        })
        /**
         * fengmap.FMSegment点集，一个点集代表一条折线
         * https://www.fengmap.com/docs/js/v2.3.0_beta/fengmap.FMSegment.html
         * */
        let seg = new fengmap.FMSegment()
        seg.groupId = gid
        seg.points = points3d
        line.addSegment(seg)
        let distance = parseInt(results[0].length)
        this.$Ctl.message(
          '<span class="message-title">距离</span>：<span class="message-value">' +
            distance +
            ' 米</span>',
          3
        )
      }
      //绘制线
      //配置线型、线宽、透明度等
      let lineStyle = {
        //设置线的宽度
        lineWidth: 6,
        //设置线的透明度
        alpha: 0.8,
        //设置线的类型为导航线
        lineType: fengmap.FMLineType.FMARROW,
        //设置线动画,false为动画
        noAnimate: true,
      }
      currentMap.drawLineMark(line, lineStyle)
    },
    /**
     * 显示热力图
     * data热力图数据
     * */
    openHeatmap(data, maxValue) {
      const that = this
      if (data.length < 1 || !maxValue) {
        // 移除
        if (heatmapOverlay && hotGroupLayer) {
          //清除热力图的所有热力点
          heatmapOverlay.clearPoints()
          //移除应用热力图
          hotGroupLayer.removeHeatMap(heatmapOverlay)
          heatmapOverlay = null
        }
      } else {
        // 创建
        mainLayers.forEach((layer, index) => {
          if (layer) {
            try {
              layer.removeAll()
            } catch (e) {}
          }
        })
        heatmapOverlay = fengmap.FMHeatMap.create(currentMap, {
          //热点半径
          radius: 30,
          //热力图透明度
          opacity: 1,
          //热力点value的最大值
          max: maxValue,
          //渐变色值，可配置
          gradient: {
            0.0: 'rgb(0,0,0)',
            0.25: 'rgb(0,0,255)',
            0.5: 'rgb(0,255,0)',
            0.75: 'rgb(255,255,0)',
            1.0: 'rgb(255,0,0)',
          },
        })
        //批量增加热点
        heatmapOverlay.addPoints(data)
        //热力图应用到哪一楼层
        hotGroupLayer = currentMap.getFMGroup(currentMap.focusGroupID * 1)
        hotGroupLayer.applyHeatMap(heatmapOverlay)
      }
    },
    //切换主题
    changeFMapTheme() {
      const that = this
      let _index = that.mapThemes.indexOf(String(currentMap.themeName))
      if (_index + 1 == that.mapThemes.length) {
        _index = 0
      }
      currentMap.themeName = that.mapThemes[Number(_index + 1)]
    },
    //修改间距
    adjustSpacing(num) {
      const that = this
      let _index = that.mapSpace.indexOf(String(currentMap.groupSpace))
      if (num && num > 0) {
        if (Number(_index + 2) > that.mapSpace.length) {
          currentMap.groupSpace = that.mapSpace[that.mapSpace.length - 1]
        } else {
          currentMap.groupSpace = that.mapSpace[Number(_index + 1)]
        }
      } else {
        if (Number(_index - 1) < 0) {
          currentMap.groupSpace = that.mapSpace[0]
        } else {
          currentMap.groupSpace = that.mapSpace[Number(_index - 1)]
        }
      }
    },
    //量高
    highMeasure() {
      const that = this
      //清空导航线
      that.clearLineMark()
      //清空起点、终点marker
      that.clearMarker()
      type = 1
    },
    //量距
    distanceMeasure() {
      const that = this
      type = 2
      if (clickFlag) {
        //清空导航线
        that.clearLineMark()
        //清空起点、终点marker
        that.clearMarker()
        //重置地图点击次数
        clickCount = 0
        //重置上一次点击坐标对象
        lastCoord = null
      } else {
        clickFlag = true
      }
    },
    //清除标记
    clearanceMarkers() {
      const that = this
      //清空导航线
      if (navi) {
        //清除导航
        navi.stop()
        navi.clearAll()
      }
      that.clearLineMark()
      //清空起点、终点marker
      that.clearMarker()
      //重置地图点击次数
      clickCount = 0
      //重置上一次点击坐标对象
      lastCoord = null
      clickFlag = false
      aroundLayers.forEach(function (layer, index) {
        //清除周边打点消防设施
        if (layer) {
          try {
            layer.removeAll()
          } catch (e) {}
        }
      })
      aroundLayers = []
      //重置点击事件
      type = 0
    },
    //隐藏文字
    hiddenText(falg) {
      const that = this
      that.hidden = !that.hidden
      for (let i = 0; i < currentMap.groupIDs.length; i++) {
        let group = currentMap.getFMGroup(currentMap.groupIDs[i])
        // 遍历图层
        group.traverse((fm, deep) => {
          if (fm instanceof fengmap.FMLabelLayer) {
            fm.visible = that.hidden
          }
        })
      }
    },
    //隐藏图标
    hideMarkers(flag) {
      const that = this
      that.isHide = !that.isHide
      for (let i = 0; i < currentMap.groupIDs.length; i++) {
        let group = currentMap.getFMGroup(currentMap.groupIDs[i])
        // 遍历图层
        group.traverse((fm, deep) => {
          if (fm instanceof fengmap.FMFacilityLayer) {
            fm.visible = that.isHide
          }
        })
      }
    },
    //切换地图为二维、三维模式
    changeMode() {
      const that = this
      if (that.planarFlag) {
        if (currentMap) {
          currentMap.viewMode = fengmap.FMViewMode.MODE_3D
        }
      } else {
        if (currentMap) {
          currentMap.viewMode = fengmap.FMViewMode.MODE_2D
        }
      }
      //更改状态
      that.planarFlag = !that.planarFlag
    },
    //周边（工具包）
    lookAround() {
      type = 3
    },
    //周边打点
    periphery(locationMap, radius, data) {
      const that = this
      aroundLayers.forEach((layer, index) => {
        if (layer) {
          try {
            layer.removeAll()
          } catch (e) {}
        }
      })
      aroundLayers = []
      if ('string' == typeof locationMap) {
        locationMap = JSON.parse(locationMap)[0]
      }
      that.addCircleMaker(locationMap, radius)
      //循环打点
      if (data.length == 0) {
        return
      }
      //let dataList = data[0].list
      for (let i = 0; i < data.length; i++) {
        //（PS:2019/9/30超哥说打点不带状态）
        for (let j = 0; j < data[i].list.length; j++) {
          let dataList = data[i].list[j]

          //let dataList = data[i].list[0]
          // console.log(i)
          //data=data[i].list[0]
          let coord = {
            x: dataList.x,
            y: dataList.y,
            indoorId: dataList.indoorId,
          }
          let info = {
            bizId: dataList.bizId,
            id: dataList.id,
            name: dataList.name,
            status: dataList.fireTType,
          }
          that.addMarker([coord], info, dataList.type, 1)
        }
      }
    },
    //清除路径
    clearLineMark() {
      currentMap && currentMap.clearLineMark()
    },
    //清空起点、终点marker
    clearMarker() {
      const that = this
      subLayers.forEach((layer, index) => {
        if (layer) {
          try {
            layer.removeAll()
          } catch (e) {}
        }
      })
      if (circleMaker) {
        circleMaker.show = false
        circleMaker = null
      }
    },
    //周边画圈(radius是周边范围，mapCoord是点击坐标的中心点)
    addCircleMaker(target, radius) {
      const that = this
      //获取当前聚焦楼层target.groupID)
      if (oldMakerId != target.indoorId && oldMakerId != null) {
        let group1 = currentMap.getFMGroup(oldMakerId)
        let layer1 = group1.getOrCreateLayer('polygonMarker')
        layer1.removeAll()
      }
      let group = currentMap.getFMGroup(target.groupID || target.indoorId)
      let layer = group.getOrCreateLayer('polygonMarker')
      if (layer != null) {
        layer.removeAll()
      }
      circleMaker = new fengmap.FMPolygonMarker({
        //设置颜色
        color: '#3CF9DF',
        //设置透明度
        alpha: 0.3,
        //设置边框线的宽度
        lineWidth: 5,
        //设置高度
        height: 3,
        //设置圆形中心点坐标
        points: {
          //设置为圆形
          type: 'circle',
          //设置此形状的中心坐标
          center: {
            x: target.x || target.mapCoord.x,
            y: target.y || target.mapCoord.y,
          },
          //设置半径
          radius: radius,
          //设置段数，默认为40段
          segments: 40,
        },
      })
      oldMakerId = target.indoorId
      layer.addMarker(circleMaker)
    },
    Navigation() {
      type = 4
      clickCount = 0
      clickFlag = true
    },
    createNavi(coordsNavi) {
      const that = this
      that.clearanceMarkers()
      currentMap.focusAlphaMode = true
      navi = null
      if (!navi) {
        //初始化导航对象
        navi = new fengmap.FMNavigation({
          //地图对象
          map: currentMap,
          //模拟导航定位图标行进的速度，单位m/s。默认5m/s。
          speed: 10,
          //导航结果文字描述内容的语言类型参数, 目前支持中英文。参考FMLanguaeType。
          naviLanguage: fengmap.FMLanguageType.ZH,
          //导航中路径规划模式, 支持最短路径、最优路径两种。默认为MODULE_SHORTEST, 最短路径。
          naviMode: fengmap.FMNaviMode.MODULE_SHORTEST,
          //导航中的路线规划梯类优先级, 默认为PRIORITY_DEFAULT, 详情参考FMNaviPriority。
          naviPriority: fengmap.FMNaviPriority.PRIORITY_DEFAULT,
          //设置起点或终点, 是否自动进行路径规划计算。默认为true
          //autoRoute: false,
          //起终点图片标注的与楼层之间的高度偏移设置。默认是6。
          imageMarkerHeight: 6,
          //导航图标
          locationMarkerUrl: '../../../ilink-bs/static/images/pointer.png',
          //设置Marker尺寸
          locationMarkerSize: 43,
          //模拟导航时是否地图跟随,默认true
          followPosition: true,
          //模拟导航时是否改变地图角度，默认false
          followAngle: true,
          //是否在导航开始时改变地图的倾斜角度,默认为true
          changeTiltAngle: true,
          //导航跟随倾斜角度
          tiltAngle: 80,
          //模拟导航开始时地图的显示比例尺, 默认值为282,表示1:282的地图比例尺。对应比例尺级别21。
          scale: 282,
          //导航线与楼层之间的高度偏移设置。默认是1。
          lineMarkerHeight: 1,
          // 设置导航线的样式
          lineStyle: {
            // 导航线样式
            lineType: fengmap.FMLineType.FMARROW,
            // 设置线的宽度
            lineWidth: 6,
          },
        })
      }
      //添加起点
      navi.setStartPoint({
        x: coordsNavi[0].x,
        y: coordsNavi[0].y,
        groupID: coordsNavi[0].groupID * 1,
        url: 'resource/ilink_1564058147093.png',
        size: 32,
        height: 5,
      })
      //添加终点
      navi.setEndPoint({
        x: coordsNavi[1].x,
        y: coordsNavi[1].y,
        groupID: coordsNavi[1].groupID * 1,
        url: 'resource/ilink_1564058171614.png',
        size: 32,
        height: 5,
      })
      if (navi.naviDistance == 0) {
        that.clearanceMarkers()
        clickCount = 0
        navi.clearAll()
        that.$Ctl.message('该位置不支持导航', 'info')
        return
      }
      // 画出导航线
      //navi.drawNaviLine();
      //路径跨楼层事件
      navi.on('crossGroup', function (group) {
        currentMap.visibleGroupIDs = currentMap.groupIDs
        console.log('跨楼层事件', group.groupId)
      })
      navi.drawNaviLine()
      navi.on('complete', function () {
        //navi.clearAll();
      })
      navi.simulate()
      currentMap.visibleGroupIDs = currentMap.groupIDs
      //显示导航按钮
      //document.getElementById('btnsGroup').style.display = 'block';
    },
    //隐藏显示其他楼层标注
    showHiddenGroupMarker(groupId) {
      const that = this
      if (groupId === -1) {
        mainLayers.forEach((layer, index) => {
          if (!layer || !layer.markers) {
            return
          }
          layer.markers.forEach((marker, i) => {
            marker.show = true
          })
        })
        return
      }
      mainLayers.forEach((layer, index) => {
        if (!layer || !layer.markers) {
          return
        }
        if (layer.groupID != groupId) {
          layer.markers.forEach((marker, i) => {
            marker.show = false
          })
        } else {
          layer.markers.forEach((marker, i) => {
            if (!marker.isRemoved) {
              marker.show = true
            }
          })
        }
      })
    },
    /**
     * 释放地图
     * */
    disposeMap() {
      if (currentMap !== null) {
        try {
          currentMap.dispose && currentMap.dispose()
          currentMap = null
          if (this.isOutDoor == 0) {
            document.getElementById('inDoorFMap').innerHTML = ''
          } else {
            document.getElementById('outFengMap').innerHTML = ''
          }
        } catch (e) {}
        console.log(`${this.isOutDoor}地图已释放！`)
      }
    },
    /*获取fmap */
    setFengMap() {
      this.$refs.sousuo.setFengMap(currentMap)
    },
    /*获取日常巡检打点数据 */
    setDayCheckData() {
      this.$refs.sousuo.setDayCheckData(dayCheckData)
    },
    //是否是室外地图双击
    isMapDbClick(event) {
      const that = this
      if (that.isOutDoor == 0) {
        return false
      }
      // 模拟双击事件
      let secondTime = new Date().getTime()
      if (secondTime - that.firstClickTime < 500) {
        if (!event.target.ID) {
          return fasle
        }
        let param = {
          parentMapId: that.options.id,
          mapMulchId: event.target.FID,
        }
        // TODO 左上角搜索工具重新设计
        // sceneType ： 0室内  1室外
        // type：0:组织平台 1:业主单位 2:建筑物 3:九小场所
        getSkipIndoorInfo(param).then((res) => {
          if (res.data && res.status == 200) {
            that.$refs.sousuo.mapDbClick(
              res.data.id,
              res.data.deployInfo ? JSON.parse(res.data.deployInfo) : []
            )
          } else {
            that.$Ctl.message('暂无该地图信息', 'info')
          }
        })
        return true
      } else {
        that.firstClickTime = secondTime
        return false
      }
    },
    //搜索结果定位
    searchLocation(item) {
      this.clearMarker()
      if (item.mapCoord) {
        let coord = {
          x: item.mapCoord.x,
          y: item.mapCoord.y,
          groupID: item.groupID * 1,
        }
        currentMap.moveTo(coord)
        currentMap.mapScaleLevel = 25
        this.addStartEndMarker(coord, 'dingwei', true)
      } else if (item.mapLocation) {
        let coord = {
          x: JSON.parse(item.mapLocation)[0].x,
          y: JSON.parse(item.mapLocation)[0].y,
          groupID: JSON.parse(item.mapLocation)[0].indoorId,
        }
        currentMap.mapScaleLevel = 25
        currentMap.moveTo(coord)
        let info = {
          bizId: item.bizId,
          id: item.id,
          name: item.name,
          status: item.fireTType,
        }
        this.markerNeedJump = true
        this.addMarker(JSON.parse(item.mapLocation), info, item.type, 1)
        this.markerNeedJump = false
      }
    },
    //周边设备定位
    peripheryLocation(info) {
      this.$store.commit('setCurrentMapType', 2)
      const that = this
      let mapCoord = info.mapLocation
      let coord = {
        x: JSON.parse(mapCoord)[0].x,
        y: JSON.parse(mapCoord)[0].y,
        groupID: JSON.parse(mapCoord)[0].indoorId * 1,
      }
      currentMap.moveTo(coord)
      currentMap.mapScaleLevel = 30
      setTimeout(() => {
        // 延迟跳动，让用户看到跳动动画
        that.markJump(
          info.type == 32 ? info.hiddenDetail.id : info.id,
          info.type
        )
      }, 500)
    },
    markJump(bizId, markType) {
      allMarker.forEach((item, index) => {
        if (item.bizId == bizId) {
          if (markType == 32) {
            this.domMarkerJump(item)
          } else if (item.jump) {
            item.stopJump && item.stopJump()
            item.jump &&
              item.jump({
                height: 3,
                times: 2,
              })
          }
        }
      })
    },
    // html画的标注物跳动
    domMarkerJump(domObj) {
      if (domObj && domObj.domNode && domObj.domNode.firstElementChild) {
        domObj.domNode.firstElementChild.classList.add('mark-jump')
        setTimeout(() => {
          // 延迟跳动，让用户看到跳动动画
          domObj.domNode.firstElementChild.classList.remove('mark-jump')
        }, 5000)
      }
    },
    //设备一张图定位
    eqLocation(location) {
      const that = this
      if (!location) {
        return
      }
      this.$store.commit('setCurrentMapType', 2)

      let indoorId = ''
      if (location.location) {
        indoorId = (JSON.parse(location.location)[0] || {}).indoorId
      }

      //当前地图
      if (currentMap && that.options.id == location.indoorMapId) {
        let coord = {
          x: location.x,
          y: location.y,
          time: 1,
          groupID: location.groupId * 1,
        }
        currentMap.moveTo(coord)
        currentMap.mapScaleLevel = that.options.scaleLevel || 25
        setTimeout(() => {
          // 延迟跳动，让用户看到跳动动画
          that.markJump(location.id, location.type)
          that.fixedPositionData = null
        }, 300)
        this.$refs.sousuo.setFloorId(indoorId)
        this.showHiddenGroupMarker(indoorId)
        if (this.$Ctl.getCurrentPage().name == 'RectificationDangers') {
          this.$Ctl.refreshMapMarkerDataToFmap(() => {
            if (!location.hiddenDetail) return
            // 隐患标记在同一位置时调整z-index
            let nowMarker = document.querySelector(
              '.domContainer-32.top-zindex'
            )
            if (nowMarker) nowMarker.classList.remove('top-zindex')
            let theMarker = document.getElementById(
              `hiddenMarker${location.hiddenDetail.id}`
            )
            if (theMarker) theMarker.classList.add('top-zindex')
          })
          setTimeout(() => {
            if (currentMap) {
              currentMap.moveTo(coord)
              currentMap.mapScaleLevel = that.options.scaleLevel || 25
            }
          }, 100)
        }
        return
      }
      //非当前地图
      //室外跳室内
      that.$Ctl.loading(1, 10000)
      let info3d = [
        {
          x: location.x,
          y: location.y,
          indoorId: location.groupId,
        },
      ]
      that.fixedPositionData = location

      if (
        localStorage.getItem('ilinkBs_outdoorMapId') != location.indoorMapId
      ) {
        if (that.isOutDoor == 1) {
          //室外跳室内和塞外
          that.$refs.sousuo.mapDbClick(location.indoorMapId, [], indoorId)
        } else {
          //室内跳室内
          that.$refs.sousuo.mapDbClick(location.indoorMapId, [], indoorId)
        }
      } else {
        //室内跳室外
        that.$refs.sousuo.changeScenes(1)
      }
      that.$Ctl.loading(0)
    },
    //日常巡检定位
    InspectionLocation(valueId, data) {
      this.$store.commit('setCurrentOrgId', data[0].orgId)
      dayCheckData = data
      let newArr = []
      data.forEach((val) => {
        if (val.result !== -1) {
          newArr.push(val)
        }
      })
      localStorage.setItem('ilinkBs_getInspectTimeLineMarkData', newArr)
      if (valueId != this.$store.state.currentInspectId) {
        //任务id变化需要切换地图
        this.$store.commit('setCurrentInspectId', valueId) //记住历史任务id
        this.$refs.sousuo.mapDbClick(data[0].indoorMapId)
        // this.$refs.sousuo.changeScenes(1);
        // if (
        //     data[0].sceneType == 0 &&
        //     data[0].indoorMapId !=
        //         localStorage.getItem("ilinkBs_fIndoorMapId")
        // ) {
        //     //初始化室内地图
        //     this.$refs.sousuo.mapDbClick(data[0].indoorMapId);
        // } else if (data[0].sceneType == 1) {
        //     //比较室外地图
        //     if (
        //         data[0].indoorMapId ==
        //         localStorage.getItem("ilinkBs_outdoorMapId")
        //     ) {
        //         this.$refs.sousuo.changeScenes(1);
        //     } else {
        //         this.$refs.sousuo.mapDbClick(data[0].indoorMapId); //切换室外地图且初始化室外地图
        //     }
        // }
      }
    },
    //接收推送数据
    pushDataToMap(markType, markData, indoorMapId, indoorId) {
      // 隐患和普通探测器 跳
      // 安全指数分数在地图，修改
      // 楼栋警情概况
      // markType = 51
      // markData = {
      //     id: 7558,
      //     info3d: '[{"x":12947624.91149151,"y":4861395.887454976,"z":56,"height":2.5,"indoorId":1}]',
      //     val:{
      //         count: "101",
      //         orgId: "146",
      //         status: "10"
      //     }
      // }
      // indoorMapId = 2
      // indoorId =1
      // 安全指数分数
      // markType = 34
      // markData = {
      //     id: 7591,
      //     info3d: '[{"x":12947290.599184643,"y":4861514.821845403,"z":56,"height":2.5,"indoorId":1}]',
      //     name: "A单位",
      //     val: 91.7
      // }
      // indoorMapId = 2
      // indoorId =1

      //隐患 缺少隐患id
      // markType = 32
      // markData = {
      //     "indoorMapId":92,
      //     "info3d":'[{"x":13480806.26950448,"y":3672337.95076412,"z":0,"height":2.5,"indoorId":1}]',
      //     "name":"706幢",
      //     "id":28715,
      //     'orgId':166,
      //     "hiddenDetail":{
      //         "fbsId":3120,
      //         "id":17,
      //         "picUrls":"http://file.kshqfire.com/ilink_1598446127911.jpg",
      //         "status":5
      //     }
      // }
      // indoorMapId = 92
      // indoorId =1

      //探测器 缺少
      // markType = 20
      // markData = {
      //     bizId: "2158960",
      //     id: 7655,
      //     info3d: '[{"x":12947254.458441611,"y":4861429.127138932,"z":56,"height":2.5,"indoorId":1}]',
      //     name: "1-01-003烟感",
      //     status: "10"
      // }
      // indoorMapId = 2
      // indoorId =1

      if (!markData || !this.mapLoaded) {
        return
      }

      markData = [markData]
      let bizId = 0
      let obj = null
      let status = null
      let count = null
      if (markType == 32) {
        //隐患整改
        bizId = markData[0].hiddenDetail.id
        status = markData[0].hiddenDetail.status
      } else if (markType == 51) {
        //楼栋警情
        bizId = markData[0].id
        count = markData[0].val.count * 1
        status = markData[0].val.status
      } else if (markType == 34) {
        //单位安全指数
        bizId = markData[0].id
      } else {
        //带状态的探测器
        bizId = markData[0].id
        status = markData[0].status
      }
      obj = markData[0]
      const that = this
      if (!obj) {
        return
      }
      let location = JSON.parse(obj.info3d)[0]
      allMarker.forEach((item) => {
        if (item.bizId == bizId) {
          item.show = false
          item.isRemoved = true
          // 如果是dom，则直接去除
          if (item.domContent) {
            mainLayers.forEach((layer) => {
              if (layer) {
                try {
                  layer.removeMarker(item)
                } catch (e) {}
              }
            })
          }
          item = null
        }
      })
      if (markType == 32) {
        //已完成 删标记
        if (status == 2) {
          return
        }
      } else if (markType == 51) {
        //楼栋警情count为0
        //状态为 0 复位
        if (count == 0 || status == 0) {
          return
        }
      } else if (markType == 34) {
        //单位安全指数
      } else {
        //带状态的探测器
        //探测器复位，删标记并且不打点
        if (status == 0) {
          return
        }
      }
      //当前地图
      if (that.options.id == indoorMapId) {
        this.$store.commit('setCurrentMapType', 2)
        this.$store.commit('setCurrentOrgId', obj.orgId)
        let coord = {
          x: location.x,
          y: location.y,
          time: 3,
          groupID: indoorId * 1,
        }
        allMarker = allMarker.filter((x) => x != null)
        this.markerNeedJump = true
        if (markType == 34 || markType == 51) {
          this.markerNeedJump = false
        } else {
          currentMap.moveTo(coord)
          currentMap.mapScaleLevel = 30
          // 自动切到单层，且视角是2D
          // currentMap.visibleGroupIDs = [indoorId]
          this.$refs.sousuo.focusGroup(indoorId * 1)
          currentMap.tiltAngle = 180
        }
        this.initFengMapMarks({ [markType]: markData }, false)
        this.markerNeedJump = false
        return
      }

      //非当前地图
      if (markType == 34 || markType == 51) {
        return
      }
      this.$Ctl.loading(1, 10000)
      let data = markData[0]
      data.indoorMapId = indoorMapId
      this.pushData = {
        type: markType,
        data: [data],
        indoorId: indoorId * 1,
      }
      this.$store.commit('setCurrentMapType', 2)
      this.$store.commit('setCurrentOrgId', obj.orgId)

      if (localStorage.getItem('ilinkBs_outdoorMapId') != indoorMapId) {
        if (this.isOutDoor == 1) {
          //室外跳室内和室外
          this.$refs.sousuo.mapDbClick(indoorMapId, [], indoorId)
        } else {
          //室内跳室内
          this.$refs.sousuo.mapDbClick(indoorMapId, [], indoorId)
        }
      } else {
        //室内跳室外
        this.$refs.sousuo.changeScenes(1)
      }
    },
    //转换蜂鸟到百度坐标
    transLocation(fengLocation, bdToF) {
      //bdToF true百度转蜂鸟   false蜂鸟转百度
      let mapCoord = {}
      if (bdToF) {
        //百度转蜂鸟
        let x = (fengLocation.lon / 180) * 20037508.34
        let y =
          Math.log(Math.tan(((90 + fengLocation.lat) * Math.PI) / 360)) /
          (Math.PI / 180)
        y = (y * 20037508.34) / 180
        mapCoord.x = x
        mapCoord.y = y
        mapCoord.z = 0
        mapCoord.height = 0
        mapCoord.indoorId = 1
      } else {
        //蜂鸟转百度
        fengLocation = JSON.parse(fengLocation)[0]
        let x = (fengLocation.x / 20037508.34) * 180
        let y = (fengLocation.y / 20037508.34) * 180
        y =
          (180 / Math.PI) *
          (2 * Math.atan(Math.exp((y * Math.PI) / 180)) - Math.PI / 2)
        mapCoord.lon = x
        mapCoord.lat = y
      }
      return mapCoord
    },
    //划线到安全出口（36）exp:location="[{"x":12947514.84945025,"y":4861688.587492615,"z":56,"height":2.5,"indoorId":1}]"
    drawLineToOut(location) {
      const that = this
      let startLocation = JSON.parse(location)[0]
      let lineStyle = {
        lineWidth: 8,
        alpha: 0.9,
        url: '',
        smooth: true,
        lineType: fengmap.FMLineType.FMARROW,
        noAnimate: false,
      }

      let startPoints = [
        {
          x: startLocation.x * 1,
          y: startLocation.y * 1,
          groupId: startLocation.indoorId * 1,
          z: 1,
        },
      ]

      let exitPoints = []
      that.getExitMarker(startLocation, function () {
        if (!allMarker) {
          that.$Ctl.message('该设备无关联安全出口标注!', 'info')
          return
        }
        allMarker.forEach((marker, index) => {
          if (marker.type == 36 && marker.groupId == startLocation.indoorId) {
            exitPoints.push({
              x: marker._x,
              y: marker._y,
              groupId: marker.groupId,
              z: 1,
            })
          }
        })
        if (exitPoints.length === 0) {
          return
        }
        for (let index = 0; index < exitPoints.length; index++) {
          let analyzeNaviResult = naviAnalyser.analyzeNavi(
            startPoints[0].groupId,
            startPoints[0],
            startPoints[0].groupId,
            exitPoints[index],
            fengmap.FMNaviMode.MODULE_SHORTEST
          )
          if (fengmap.FMRouteCalcuResult.ROUTE_SUCCESS != analyzeNaviResult) {
            continue
          }
          //获取路径分析结果对象，所有路线集合
          let results = naviAnalyser.getNaviResults()
          if (results.length > 2) {
            results.splice(0, results.length - 1)
          }
          let line = new fengmap.FMLineMarker()
          for (let i = 0; i < results.length; i++) {
            let result = results[i]
            //楼层id
            let gid = result.groupId
            //路径线点集合
            let points = result.getPointList()

            let points3d = []
            points.forEach((point) => {
              points3d.push({
                //x坐标点
                x: point.x,
                //y坐标点
                y: point.y,
                //线标注高度
                z: 1,
              })
            })
            let seg = new fengmap.FMSegment()
            seg.groupId = gid
            seg.points = points3d
            line.addSegment(seg)
            currentMap.drawLineMark(line, lineStyle)
          }
        }
      })
    },
    //获取安全出口标注
    getExitMarker(location, callback) {
      const that = this
      let parames = {
        orgIds: localStorage.getItem('ilinkBs_orgIds'),
        types: '36',
        typeGroup: 10,
        indoorMapId: that.options.id,
        indoorId: location.indoorId,
        queryType: 0,
      }
      getMarkers(parames).then((res) => {
        if (res.status !== 200) {
          return
        }
        if (res.data.length === 0) {
          that.$Ctl.message('该设备无关联安全出口标注!', 'info')
          return
        }
        let markers = res.data
        for (let index = 0; index < markers.length; index++) {
          let element = markers[index]
          that.addSafeMarker(JSON.parse(element.mapLocation), element, 36)
        }
        callback && callback()
      })
    },
    changeMapType(type) {
      //1室外 0室内
      this.isOutDoor = type
      localStorage.setItem('ilinkBs_inoutDoorType', type)
    },
    // 判断是多单位首页还是单单位首页
    isHomeMuil() {
      let isMisMuilUnitUser = this.$store.state.userInfo.isMuilUnitUser //0:单单位用户;1:多单位用户
      let _OrgIds = localStorage.getItem('ilinkBs_orgIds')
      return isMisMuilUnitUser && _OrgIds.split(',').length > 1 ? true : false
    },
  },
}
</script>

<style rel="stylesheet/scss" lang="scss">
.domContainer-common {
  z-index: 2; //防止后面的文字超过前面的背景图片
  position: relative;
  height: 100%;
  width: 100%;
  cursor: pointer;
  background-size: 100% 100%;
  line-height: 100px;
  text-align: center;
  color: #fff;
  /* &:hover, */
  &.mark-jump {
    animation: unit-jump 2s linear infinite;
  }
  // 标记在同一位置时使用
  &.top-zindex {
    z-index: 3;
  }
}
.domContainer-bg-common {
  position: relative;
  height: 100%;
  width: 100%;
  background-size: 100% 100%;
}
/* 楼栋显示室内统计 */
.domContainer-9999 {
  @extend .domContainer-common;
  span {
    position: relative;
    z-index: 1;
    font-size: 16px;
  }
  .domContainer-9999-bg {
    @extend .domContainer-bg-common;
    position: absolute;
    left: 0;
  }
}
/* 单位安全指数 */
.domContainer-34 {
  @extend .domContainer-common;
  span {
    position: relative;
    z-index: 1;
    font-size: 16px;
  }
  .domContainer-34-bg {
    @extend .domContainer-bg-common;
    position: absolute;
    left: 0;
  }
}
/* 维保 */
.domContainer-33 {
  @extend .domContainer-common;
  span {
    position: relative;
    top: 28px;
    z-index: 1;
    font-size: 16px;
  }
  .domContainer-33-bg {
    @extend .domContainer-bg-common;
    position: absolute;
    left: 0;
  }
}
/* 巡检 */
.domContainer-22 {
  @extend .domContainer-common;
  .domContainer-22-bg {
    @extend .domContainer-bg-common;
    position: absolute;
    left: 0;
  }
}
/* 楼栋报警个数 */
.domContainer-51 {
  @extend .domContainer-common;
  span {
    position: relative;
    z-index: 1;
    font-size: 20px;
    font-weight: bold;
  }
  .domContainer-51-bg {
    @extend .domContainer-bg-common;
    position: absolute;
    left: 0;
  }
}
/* 隐患 */
.domContainer-32 {
  @extend .domContainer-common;
  .domContainer-32-pic {
    position: absolute;
    left: 15px;
    top: 15px;
    -o-object-fit: cover;
    object-fit: cover;
    vertical-align: top;
    width: 110px;
    height: 110px;
  }
  .domContainer-32-bg {
    @extend .domContainer-bg-common;
  }
}
.fmap-container {
  position: relative;
  height: 100%;
  width: 100%;
  background: url(../../assets/images/fmap/fmap-bg.png) 0 0 no-repeat;
  background-size: 100% 100%;
  #outFengMap,
  #inDoorFMap {
    height: 100%;
    width: 100%;
  }
  .fmap-search-wrap {
    z-index: 11;
    position: absolute;
    top: 40px;
    // margin-top: 30px;
    margin-left: 4%;
    // width: 10%;
  }
  &.is-kshqxf {
    background-image: url(../../assets/images/fmap/fmap-bg-star.png);
  }
}
</style>
